package com.kehao.leetcode.basic.math;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class FizzBuzzSolution {
    public List<String> fizzBuzz(int n) {
        List<String> result = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            String temp="";
            if(i%3==0){
                temp+="Fizz";
            }
            if(i%5==0){
                temp+="Buzz";
            }
            if(temp.equals("")){
                temp+= i;
            }
            result.add(temp);
        }
        return result;
    }

    @Test
    public void test01(){
        System.out.println(fizzBuzz(3));
    }
}
